package com.neuedu.mvc.entity;


import com.neuedu.mvc.valid.ValiditionUserName;

import javax.validation.constraints.Max;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;

/**
 * 用户的实体对象
 */
public class User {

    private Integer userId;

    @Size(min = 2,max = 5,message = "{userName.size.error}",groups = ValiditionUserName.class)
    private String userName;
    private String gender;
    private Date birthday;


    @Max(value = 2,message = "{status.max.error}" )
    @NotNull(message = "{status.notnull.error}")
    private Integer status;

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    @Override
    public String toString() {
        return "User{" +
                "userId='" + userId + '\'' +
                ", userName='" + userName + '\'' +
                ", gender='" + gender + '\'' +
                ", birthday=" + birthday +
                ", status=" + status +
                '}';
    }
}